extends ../layout

block content
  style
    include ../login/index.css
  .w-100.h-100.login-box
    h1.text-center.pt-5
      span 注册
      span  | 
      a(href="/login") 登录

    if err
      .text-danger.text-center.mb-2= err

    .row
      .col-4.m-auto
        form(action="/register" method="post")
          .form-group.row.mb-4
            label.col-2.col-form-label(for="username") 用户名：
            input.col-10(type="text" name="username" value=(!!user ? user.username : ''))
          .form-group.row.mb-4
            label.col-2.col-form-label(for="pwd") 密码：
            input.col-10(type="password" name="pwd" value=(!!user ? user.pwd : ''))
          .form-group.row
            button.btn.btn-primary(type="submit") 注册

    script
      include index.js